/*This is the do file for the article "White or Woke Christian Nationalists."
It contains code for replicating variables, tables, and figures.*/

ssc install schemepack, replace
ssc install combomarginsplot

use "C:\Users\admin\Desktop\DATA File\Data for Replication - Woke Christian Nationalists.dta"

*CODING INSTRUCTIONS FOR VARIABLES INCLUDED IN THE MODELS:

*Creating outcomes
recode W3_Q157_f (1=1) (2=2) (5=3) (3=4) (4=5), gen(woke)
recode W3_Q157_f (1=1) (2=2) (3=3) (4=4) (5=.), gen(woke4)
recode W3_Q157_d (1=1) (2=2) (5=3) (3=4) (4=5), gen(progressive)
recode W3_Q157_d (1=1) (2=2) (3=3) (4=4) (5=.), gen(progressive4)

*Creating the Main Christian Nationalism Index
rename W3_Q120_a godsplan3
rename W3_Q120_c cnation3
rename W3_Q120_d founding3
rename W3_Q120_e american3
recode W3_Q157_e (1=1) (2=2) (5=3) (3=4) (4=5), gen(cnist)
gen cn3 = godsplan3 + cnation3 + founding3 + american3 + cnist

*Creating the Christian Nationalism Index with the "Christian Nationalist" item removed. (Supplementary analysis)
gen cn3_short = godsplan3 + cnation3 + founding3 + american3

*Creating the Christian Nationalism Index with the item about Church-State separation included. (Supplementary analysis)
recode W3_Q120_k (1=5) (2=4) (3=3) (4=2) (5=1), gen(churchstate3)
gen cn3_expand = godsplan3 + cnation3 + founding3 + american3 + cnist + churchstate3

*Creating Control Variables:
gen age = 2023 - birthyr
recode race (1=1 "White") (2=2 "Black") (3=3 "Hispanic") (4/8=4 "Other Race"), gen(race4)
recode gender4 (1=1 "Man") (2=2 "Woman") (3/4=3 "Non-Binary"), gen(gender)
recode faminc_new (1/3=1 "Less than $30,000") (4/6=2 "$30,000-$59,999") (7/9=3 "$60,000-$99,999") (10/12=4 "$100,000-$199,999") (13/16=5 "$200,000 or more") (97=6 "Did not say"), gen(income)
recode inputstate (1=1) (5=1) (10/13=1) (21/22=1) (24=1) (28=1) (37=1) (40=1) (45=1) (47/48=1) (51=1) (54=1) (else=0), gen(south)
recode pid3 (1=1 "Democrat") (2=2 "Republican") (3=3 "Independent") (4/5=4 "Other/Not Sure"), gen(party4)
recode ideo5 (1=1 "Very Liberal") (2=2 "Liberal") (3=3 "Moderate/Not Sure") (4=4 "Conservative") (5=5 "Very Conservative") (6=3 "Moderate/Not Sure"), gen(ideo)
recode religpew (1=1 "Protestant") (2=3 "Catholic") (3/4=4 "Other Christian") (5/8=5 "Non-Christian") (12=5 "Non-Christian") (9=6 "Atheist") (10=7 "Agnostic") (11=8 "Nothing in Particular"), gen(reltrad)
replace reltrad = 2 if religpew==1 & pew_bornagain==2

*Creating the Religiosity Index requires several steps.
recode pew_churatd (1=6 "More than once a week") (2=5 "Once a week") (3=4 "Once or twice a month") (4=3 "A few times a year") (5=2 "Seldom") (6/7=1 "Never"), gen(attend)
recode pew_prayer (1=7 "Several times a day") (2=6 "Once a day") (3=5 "A few times a week") (4=4 "Once a week") (5=3 "A few times a month") (6=2 "Seldom") (7/8=1 "Never"), gen(prayer)
recode pew_religimp (1=4 "Very important") (2=3 "Somewhat important") (3=2 "Not too important") (4=1 "Not at all important"), gen(relimp)

sum attend
gen attend01 = (attend-r(min)) / (r(max)-r(min))
sum prayer
gen prayer01 = (prayer-r(min)) / (r(max)-r(min))
sum relimp
gen relimp01 = (relimp-r(min)) / (r(max)-r(min))
gen relindex = attend01 + prayer01 + relimp01
sum relindex
gen relindex201 = (relindex-r(min))/(r(max)-r(min))

*rescaling all continuous or ordinal items from 0 to 1 is done as follows:
sum woke
gen woke_01 = (woke-r(min))/(r(max)-r(min))
sum woke4
gen woke4_01 = (woke4-r(min))/(r(max)-r(min))
sum progressive
gen progressive_01 = (progressive-r(min))/(r(max)-r(min))
sum progressive4
gen progressive4_01 = (progressive4-r(min))/(r(max)-r(min))
sum cn3
gen cn3_01 = (cn3-r(min))/(r(max)-r(min))
sum cn3_short
gen cn3_short_01 = (cn3_short-r(min))/(r(max)-r(min))
sum cn3_expand
gen cn3_expand_01 = (cn3_expand-r(min))/(r(max)-r(min))
sum age
gen age_01 = (age-r(min))/(r(max)-r(min))
sum educ
gen educ_01 = (educ-r(min))/(r(max)-r(min))
sum ideo
gen ideo_01 = (ideo-r(min))/(r(max)-r(min))


*CODE FOR PRODUCING RESULTS FOR DESCRIPTIVE TABLE 1: (actual tables were created in word)

*unweighted
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201, listwise
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==1, listwise
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==2, listwise
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==3, listwise

*weighted
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight], listwise
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==1 [pw=weight], listwise
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==2 [pw=weight], listwise
dtable woke_01 progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==3 [pw=weight], listwise

*CODE FOR PRODUCING RESULTS FOR BIVARIATE CORRELATION TABLE 2: (actual tables were created in word)
pwcorr woke_01 cn3_01 [weight=weight], sig obs
pwcorr progressive_01 cn3_01 [weight=weight], sig obs
pwcorr woke_01 cn3_01 if race4==1 [weight=weight], sig obs
pwcorr progressive_01 cn3_01 if race4==1 [weight=weight], sig obs
pwcorr woke_01 cn3_01 if race4==2 [weight=weight], sig obs
pwcorr progressive_01 cn3_01 if race4==2 [weight=weight], sig obs
pwcorr woke_01 cn3_01 if race4==3 [weight=weight], sig obs
pwcorr progressive_01 cn3_01 if race4==3 [weight=weight], sig obs

*CODE FOR RUNNING MODELS FROM TABLE 3:

*Model 1

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 2

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

*Model 3

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 4

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]



*CODE FOR RUNNING MODELS FROM TABLE 4:

*White/Woke

reg woke_01 c.cn3_01 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==1 [pw=weight]

*Black/Woke

reg woke_01 c.cn3_01 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==2 [pw=weight]

*Hispanic/Woke

reg woke_01 c.cn3_01 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==3 [pw=weight]

*White/Progressive

reg progressive_01 c.cn3_01 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==1 [pw=weight]

*Black/Progressive

reg progressive_01 c.cn3_01 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==2 [pw=weight]

*Hispanic/Progressive

reg progressive_01 c.cn3_01 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 if race4==3 [pw=weight]



*CODE FOR RUNNING MODELS FROM TABLE 5:

*Democrat/Woke

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==1 [pw=weight]

*Republican/Woke

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==2 [pw=weight]

*Independent/Woke

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==3 [pw=weight]

*Democrat/Progressive

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==1 [pw=weight]

*Republican/Progressive

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==2 [pw=weight]

*Independent/Progressive

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==3 [pw=weight]



*CODE FOR PRODUCING FIGURE 1:

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(stcolor) recastci(rarea) ciopts(fcolor(%50)) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")



*CODE FOR PRODUCING FIGURE 2:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

margins race4 if race4<4, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(stcolor) recastci(rarea) ciopts(fcolor(%50)) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")

*Note: We adjusted the legend in graph editor.




/*The following code is for replicating regression tables and figures from the
Supplementary Materials*/


*CODE FOR PRODUCING REGRESSION TABLE S4 IN SUPPLEMENTARY MATERIAL:

*Model 1:

reg woke4_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 2:

reg woke4_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

*Model 3:

reg progressive4_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 4:

reg progressive4_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]



*CODE FOR PRODUCING REGRESSION TABLE S5 IN SUPPLEMENTARY MATERIAL:

*Model 1

reg woke_01 c.cn3_short_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 2

reg woke_01 c.cn3_short_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_short_01##i.race4 [pw=weight]

*Model 3

reg progressive_01 c.cn3_short_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 4

reg progressive_01 c.cn3_short_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_short_01##i.race4 [pw=weight]



*CODE FOR PRODUCING REGRESSION TABLE S6 IN SUPPLEMENTARY MATERIAL:

*Model 1:

reg woke_01 c.cn3_expand_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 2:

reg woke_01 c.cn3_expand_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_expand_01##i.race4 [pw=weight]

*Model 3:

reg progressive_01 c.cn3_expand_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 [pw=weight]

*Model 4:

reg progressive_01 c.cn3_expand_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_expand_01##i.race4 [pw=weight]



*CODE FOR PRODUCING FIGURE S2 IN SUPPLEMENTARY MATERIAL:

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1))

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(marginal probabilities) title("")



*CODE FOR PRODUCING FIGURE S3 IN SUPPLEMENTARY MATERIAL:

*Panel A (Black vs. White)

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1))

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(marginal probabilities) title("")


*Panel B (Hispanic vs. White)

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south i.party4 c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 [pw=weight]

margins race4 if race4==1 | race4==3, at(cn3_01=(0(.1)1))

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(marginal probabilities) title(.)



*CODE FOR PRODUCING FIGURE S4 IN SUPPLEMENTARY MATERIAL:

*Panel A:

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==1 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")

*Panel B: 

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==2 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")


*Panel C:

reg woke_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==3 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")



*CODE FOR PRODUCING FIGURE S5 IN SUPPLEMENTARY MATERIAL:

*Panel A:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==1 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")

*Panel B:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==2 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")


*Panel C:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==3 [pw=weight]

margins race4 if race4<3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")



*CODE FOR PRODUCING FIGURE S6 IN SUPPLEMENTARY MATERIAL:

*Panel A:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==1 [pw=weight]

margins race4 if race4==1 | race4==3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")

*Panel B:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==2 [pw=weight]

margins race4 if race4==1 | race4==3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")


*Panel C:

reg progressive_01 c.cn3_01 i.race4 c.age_01 i.gender c.educ_01 i.income i.south c.ideo_01 i.reltrad c.relindex201 c.cn3_01##i.race4 if party4==3 [pw=weight]

margins race4 if race4==1 | race4==3, at(cn3_01=(0(.1)1)) atmeans contrast(effects)

marginsplot, scheme(white_tableau) xtitle(Christian Nationalism) ytitle(Contrasts of linear prediction) yline(0, lcolor(red)) title("")























